package view;

import java.awt.BorderLayout;

import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;

/**
 * Class is responsible for frame that includes text field only.
 * Frame contains: 	text field.
 * 					Standart buttons.
 */
public abstract class AbstractTextFieldFrame extends AbstractCommonFrame
{	
	/**
	 * C'tor - Frame with specified title and text field label is created.
	 * @param title		- the table title.
	 * @param labelText	- the label that appear before the text field.
	 */
	public AbstractTextFieldFrame(String title, String labelText)
	{
		/* Window's characteristics */
		super(title);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setSize(Globals.textBoxFrameSize);
		setLayout(new BorderLayout());

		/* Label */
		JLabel label = new JLabel(labelText);
	    add(label, BorderLayout.NORTH);

		/* Standart buttons */
	    addStandartButtons();
	    
		setLocationRelativeTo(null);
	}
	
	public void addDataField(JComponent field)
	{
	    add(field, BorderLayout.CENTER);		
	}
}
